#ifndef TCPRECOGNIZECLIENT_H
#define TCPRECOGNIZECLIENT_H

#include <QAbstractSocket>
#include <QDebug>
#include <QFile>
#include <QFileInfo>
#include <QHostAddress>
#include <QMetaType>
#include <QStandardPaths>
#include <QString>
#include <QTcpSocket>

class TCPRecognizeClient : public QObject
{
    Q_OBJECT

public:
    explicit TCPRecognizeClient(QWidget *parent = nullptr);
    ~TCPRecognizeClient();

signals:
    void newResultMessage(QString);

public:
    void sendProtocolMessage(QString str);
    void sendAttachment(QString filePath);

    void sendRawMessage(QString str);

private:
    void Init();

public:
    void ConnectServer(QString strIP, int port);

private slots:
    void readSocket();
    void discardSocket();
    void displayError(QAbstractSocket::SocketError socketError);

private:
    QTcpSocket *socket;
};

#endif // TCPRECOGNIZECLIENT_H
